﻿using System;
using Utils;

namespace Plugins.UserControls
{
	[Serializable]
	public class HourSelectorData : PropertyChangedNotifierCopyable<HourSelectorData>, ICloneable<HourSelectorData>
	{
		#region Attributes

		private bool _startWithOpening;
		private TimeSpan? _operationStart;
		private TimeSpan _lastOpen;
		private TimeSpan _forcedCloseTime;

		#endregion

		#region Properties

		public bool StartWithOpening
		{
			get
			{
				return _startWithOpening;
			}
			set
			{
				if (_startWithOpening != value)
				{
					_startWithOpening = value;
					base.OnPropertyChanged("StartWithOpening");
				}
			}
		}

		public TimeSpan? OperationStart
		{
			get
			{
				return _operationStart;
			}
			set
			{
				if (_operationStart != value)
				{
					_operationStart = value;
					base.OnPropertyChanged("OperationStart");
				}
			}
		}

		public TimeSpan LastOpen
		{
			get
			{
				return _lastOpen;
			}
			set
			{
				if (_lastOpen != value)
				{
					_lastOpen = value;
					base.OnPropertyChanged("LastOpen");
				}
			}
		}

		public TimeSpan ForcedCloseTime
		{
			get
			{
				return _forcedCloseTime;
			}
			set
			{
				if (_forcedCloseTime != value)
				{
					_forcedCloseTime = value;	
					base.OnPropertyChanged("ForcedCloseTime");
				}
			}
		}

		#endregion

		#region ICloneable

		public HourSelectorData Clone()
		{
			return (HourSelectorData)this.MemberwiseClone();
		}

		#endregion
    }
}
